package de.dqi.pong.menu;

import java.awt.Font;

import javax.swing.*;

import de.dqi.pong.AILoader;

/**
 * TODO PlayMenu - finish class definition
 * <hr>
 * 
 * <hr><dl><dt>
 * Summary: </dt><br><dd>
 *  
 * </dd><br><dt>
 * Author: </dt><br><dd>
 *  Melina
 * </dd></dl>
 */
public class PlayMenu
		extends MenuPanel {
	
	private static final long	serialVersionUID	= 5873155239462552831L;
	private JComboBox<String>	box1;
	private JComboBox<String>	box2;
	
	public PlayMenu(JPanel startGui) {
		setSize(250, 300);
		setLayout(null);
		
		parent = startGui;
		
		JLabel text = new JLabel();
		text.setText("Play");
		text.setHorizontalAlignment(SwingConstants.CENTER);
		text.setFont(new Font("Times New Roman", Font.BOLD, 30));
		text.setBounds(0, 0, 250, 50);
		add(text);
		
		JLabel player1 = new JLabel();
		player1.setText("Player 1");
		player1.setHorizontalAlignment(SwingConstants.CENTER);
		player1.setFont(new Font("Times New Roman", Font.PLAIN, 14));
		player1.setBounds(0, 60, 250, 25);
		add(player1);
		
		JLabel player2 = new JLabel();
		player2.setText("Player 2");
		player2.setHorizontalAlignment(SwingConstants.CENTER);
		player2.setFont(new Font("Times New Roman", Font.PLAIN, 14));
		player2.setBounds(0, 120, 250, 25);
		add(player2);
		
		box1 = new JComboBox<String>(AILoader.getLoadedAIs());
		box1.setBounds(0, 90, 250, 25);
		box1.setEditable(false);
		add(box1);
		
		box2 = new JComboBox<String>(AILoader.getLoadedAIs());
		box2.setBounds(0, 150, 250, 25);
		box1.setEditable(false);
		add(box2);
		
		JButton exit = new MenuButton(Frame.GAME);
		exit.setText("Play");
		exit.setBounds(0, 200, 250, 50);
		exit.addActionListener(MenuListener.getInstance());
		add(exit);
		
		JButton back = new MenuButton(0);
		back.setText("Back");
		back.setBounds(0, 250, 250, 50);
		back.addActionListener(MenuListener.getInstance());
		add(back);
	}
	
	int getChoiceOne() {
		return box1.getSelectedIndex();
	}
	
	int getChoiceTwo() {
		return box2.getSelectedIndex();
	}
}